package com.wingsofts.gankclient.mvp.presenter

import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable

/**
 * Created by wing on 16-11-24.
 */
open class BasePresenter {
    private var compositeSubscription = CompositeDisposable()

    protected fun addSubscription(subscription: Disposable) {
        compositeSubscription.add(subscription)
    }

    fun unSubscribe() {
        if (compositeSubscription.isDisposed) {
            compositeSubscription.clear()
        }
    }
}